package com.fang.result;

/**
 * @Description 常用结果的枚举
 * @Author Mr.Wang
 * @Date 2024-12-23 17:05
 **/
public enum ResultEnum implements IResult {
    SUCCESS(2001, "接口调用成功"),
    COMMON_FAILED(2002, "接口调用失败"),
    VALIDATE_FAILED(2003, "参数校验失败"),
    FORBIDDEN(2004, "没有权限访问资源");

    private Integer code;
    private String message;

    ResultEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
